<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:98:"H:\wamp\www\DianZhuanJin\public/../application/admin/view/commoditydo/get_sole_commodity_list.html";i:1559263539;s:57:"H:\wamp\www\DianZhuanJin\application\admin\view\base.html";i:1560306104;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <title>
点赚金-后台管理-商品管理
</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css" href="/DianZhuanJin/public/static/assets/lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/DianZhuanJin/public/static/assets/stylesheets/theme.css">
    <link rel="stylesheet" href="/DianZhuanJin/public/static/assets/lib/font-awesome/css/font-awesome.css">

    <script src="/DianZhuanJin/public/static/assets/lib/jquery-1.8.1.min.js" type="text/javascript"></script>

    <!-- Demo page code -->
    
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>
    
	<style>
		.table th, .table td {
			text-align: center;
			vertical-align: middle!important;
		}
		#img_picture li,#Pics{
			display:inline-block;
			float:left;
		}
	</style>
	<script>
		function cleanPicInput(){
			$("#commodity_picture").val("");
			$("#img_picture").html("");
		}
	</script>

  </head>

  <body> 
    
    <div class="navbar">
        <div class="navbar-inner">
            <div class="container-fluid">
                <ul class="nav pull-right">
                    
                    <li id="fat-menu" class="dropdown">
                        <a href="#" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-user"></i> <?php echo \think\Session::get('admin_name'); ?>
                            <i class="icon-caret-down"></i>
                        </a>

                        <ul class="dropdown-menu">
                            <li><a data-title="rest password" data-toggle="modal" data-target="#reset_admin" tabindex="-1" href="#">修改密码</a></li>
                            <li class="divider"></li>
                            <li><a tabindex="-1" href="<?php echo url('index/logout'); ?>">退出登录</a></li>
                        </ul>
                    </li>
                    
                </ul>
                <a class="brand" href="<?php echo url('index/index/login'); ?>"><span class="first">点赚金</span> <span class="second">二手交易平台</span></a>
            </div>
        </div>
    </div>
    

    <div class="container-fluid">
        
        <div class="row-fluid">
          <!-- 侧边栏 -->
            <div class="span3">
                <div class="sidebar-nav">
                <!-- 一个菜单项 -->
                  <div class="nav-header" data-toggle="collapse" data-target="#user-menu"><i class="icon-user"></i>用户管理</div>
                    <ul id="user-menu" class="nav nav-list collapse in">
                        <li><a href="<?php echo url('userdo/userList'); ?>">用户列表</a></li>
                        <li><a href="<?php echo url('userdo/deleteUserList'); ?>">已删除用户列表</a></li>                 
                    </ul>
                <!-- 一个菜单项 -->
                <div class="nav-header" data-toggle="collapse" data-target="#commodity-menu"><i class="icon-th-large"></i>商品管理</div>
                <ul id="commodity-menu" class="nav nav-list collapse in">
                  <li ><a href="<?php echo url('commoditydo/getUnauditedCommodityList'); ?>">未审核商品列表</a></li>
                  <li ><a href="<?php echo url('commoditydo/getAuditedCommodityList'); ?>">已审核商品列表</a></li>
                  <li ><a href="<?php echo url('commoditydo/getSoleCommodityList'); ?>">已售出商品列表</a></li>
                </ul>

                <div class="nav-header" data-toggle="collapse" data-target="#category-menu"><i class="icon-tags"></i>分类管理</div>
                <ul id="category-menu" class="nav nav-list collapse in">
                  <li ><a href="<?php echo url('categorydo/getCategoryList'); ?>">分类列表</a></li>
                </ul>

                <div class="nav-header" data-toggle="collapse" data-target="#order-menu"><i class="icon-shopping-cart"></i>订单管理</div>
                <ul id="order-menu" class="nav nav-list collapse in">
                  <li ><a href="<?php echo url('orderdo/getOrder'); ?>">未完成订单</a></li>
                  <li ><a href="<?php echo url('orderdo/getDoneOrder'); ?>">已完成订单</a></li>
                  <li ><a href="<?php echo url('orderdo/getDeleteOrder'); ?>">已删除订单</a></li>
                </ul>
                <div class="nav-header" data-toggle="collapse" data-target="#cash-menu"><i class="icon-credit-card"></i>提现管理</div>
                <ul id="cash-menu" class="nav nav-list collapse in">
                  <li ><a href="<?php echo url('cashdo/getUnauditedCashList'); ?>">待审核提现记录</a></li>
                  <li ><a href="<?php echo url('cashdo/getAuditedCashList'); ?>">已审核提现记录</a></li>
                </ul>
                <div class="nav-header" data-toggle="collapse" data-target="#cash-menu"><i class="icon-credit-card"></i>配送员管理</div>
                <ul id="cash-menu" class="nav nav-list collapse in">
                  <li ><a href="<?php echo url('courierdo/getCourierList'); ?>">配送员管理</a></li>
                  <li ><a href="<?php echo url('courierdo/registercode'); ?>">注册码</a></li>
                </ul>
            </div>
        </div>
        <!-- 侧边栏 -->
        <div class="span9">
          <h1 class="page-title">
已售出商品列表
</h1>
          <!-- 页面体 -->
          
<!-- 一个表格 -->
<div class="btn-toolbar">
    <button class="btn btn-success" onclick="javascript:location.reload()">刷新</button>
  <div class="btn-group">
  </div>
</div>
<div class="well">
    <table class="table table-bordered" >
			<thead>
				<tr>
					<th>#</th>
					<th>商品名称</th>
					<th>商品图片</th>
					<th>分类</th>
					<th>商品价格</th>
					<th>发布时间</th>
					<th>售出时间</th>
				</tr>
			</thead>
			<tbody id="commoditys">
				<?php if(is_array($commoditys) || $commoditys instanceof \think\Collection || $commoditys instanceof \think\Paginator): $i = 0; $__LIST__ = $commoditys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$commodity): $mod = ($i % 2 );++$i;?>
				<tr id="<?php echo $commodity['commodity_id']; ?>">
					<th scope="row"><?php echo $i; ?></th>
					<td><?php echo $commodity['commodity_name']; ?></td>
					<td><img onclick="getPics('<?php echo $commodity['commodity_id']; ?>')" style="height: 150px" src="<?php echo $commodity['picture_address']; ?>"></td>
					<td><?php echo $commodity['category_name']; ?></td>
					<td><?php echo $commodity['commodity_price']; ?> 元</td>
					<td><?php echo $commodity['gmt_create']; ?></td>
					<td><?php echo $commodity['gmt_sold']; ?></td>
				</tr>
				<?php endforeach; endif; else: echo "" ;endif; ?>	
			</tbody>
		</table>
</div>
<div class="pagination">
    <?php echo $commoditys->render(); ?>
</div>

<script>
	function getPics(commodity_id){
		$.getJSON("<?php echo url('getCommodityPic'); ?>",{commodity_id:commodity_id},function(data){
			$("#Pics").html("");
			if(0 == data.code){
				var pictures = data.data;
				for(var i=0;i<pictures.length;i++){
					$("#Pics").append("<li><img style='width:100px' src='"+pictures[i].picture_address+"'></li>");
				}
				$('#show_pic').modal('show');
			}else{
				alert("获取图片失败");
			}
		});
	}
</script>

          <!-- 页面体 -->
        </div>
        </div>
    <footer>
        <hr>        
        <p>&copy; 2019 <a href="http://www.neusoft.edu.cn/">大连东软信息学院</a></p>
        <p>PHP课程实践 李佳伟 蒙樊健 王磊</p>
    </footer>

    
	<div id="show_pic" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3 id="myModalLabel">商品图片</h3>
		</div>
	    <form class="form-horizontal">
	    	 <div class="control-group">
	            <div class="controls">
	              	 <ul id="Pics" >
	        		</ul>
	        	</div>
	        </div>
	    </form>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
		</div>
	</div>

    <script>
      function resetAdmin(){
        var form = new FormData(document.getElementById("resetAdmin"));
        $.ajax({
            url:"<?php echo url('index/resetPassword'); ?>",
            type:"post",
            data:form,
            processData: false,                // jQuery不要去处理发送的数据
            contentType: false,
            dataType: 'json',
            success:function(data){
              if (0 == data.code) {
                alert(data.msg);
                window.location.href="<?php echo url('index/logout'); ?>";
              }else{
                alert(data.msg);
              }
               
            }
            }); 
    }
  </script>
  <div id="reset_admin" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
      <h3 id="myModalLabel">重置密码</h3>
    </div>
    <form id="resetAdmin" class="form-horizontal" onsubmit="return false;" method="post">
      <br>
      <input type="hidden" name="admin_id" value="<?php echo \think\Session::get('admin_id'); ?>"><br>
      <div class="control-group">
          <label class="control-label">原密码</label>
          <div class="controls">
            <input type="password" name="old" placeholder="请输入原密码" required><br>
        </div>
      </div>
      <div class="control-group">
          <label class="control-label">新密码</label>
          <div class="controls">
            <input type="password" name="new" placeholder="请输入新密码" required><br>
        </div>
      </div>
    </form>
    <div class="modal-footer">
      <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
      <input class="btn" type="button" value="提交" onclick="resetAdmin();">
    </div>
  </div>


    <script src="/DianZhuanJin/public/static/assets/lib/bootstrap/js/bootstrap.js"></script>

  </body>
</html>


